const state = {}
const mutations = {
  SET_MARKET_QUREY: (state, { key, value }) => {
    if (value.hasOwnProperty('filingTime')) {
      if (value['filingTime'] == null || value['filingTime'] == undefined) {
        return
      } else {
        value['filingTime'] = value['filingTime'].toString()
      }
    }
    if (value.hasOwnProperty('visitDiseaseArray')) {
      if (
        value['visitDiseaseArray'] == null ||
        value['visitDiseaseArray'] == undefined
      ) {
        return
      } else {
        value['visitDiseaseArray'] = value['visitDiseaseArray'].toString()
      }
    }
    if (value.hasOwnProperty('channel')) {
      if (value['channel'] == null || value['channel'] == undefined) {
        return
      } else {
        value['channel'] = value['channel'].toString()
      }
    }
    state[key] = value
  },
}
const actions = {
  async setMarketQuery({ commit }, { path, data }) {
    await commit('SET_MARKET_QUREY', { key: path, value: data })
  },
}

export default {
  namespaced: true,
  state,
  mutations,
  actions,
}
